<template>
	<view class="forum">
		<view class="content" 
		v-for="(item,index) in content" 
		:key="index" >
		<view class="mainFroumItem" @click="toforumContent(item.path)">
			<view class="header">
				<view class="headPortrait">
					<image src="../../static/icons/qq.png" mode=""></image>
				</view>
				<view class="user">
					<text class="userName">{{item.user.userName}}</text>
					<text class="time">{{item.user.time}}</text>
				</view>
			</view>
			<view class="title">
				{{item.title}}
			</view>
			<view class="topic">
				 {{item.topic}}
			</view>
		</view>
		
		
	<!-- 	<view class="mainFroumItem" @click="toforumContent(item.path)">
			<view class="header">
				<view class="headPortrait">
					<image src="../../static/icons/qq.png" mode=""></image>
				</view>
				<view class="user1">
					<text class="userName">{{item.user.userName}}</text>
					<text class="time">{{item.user.time}}</text>
				</view>
			</view>
			<view class="title">
				{{item.title}}
			</view>
			<view class="topic">
				 {{item.topic}}
			</view>
		</view> -->
		
		
		
			<view class="operation">
				<view class="operationItem">
					<image src="../../static/icons/transmit.png" mode=""></image>
					<text>114</text>
				</view>
				<view class="operationItem">
					<image src="../../static/icons/leaveMess.png" mode=""></image>
					<text>1241</text>
				</view>
				<view class="operationItem">
					<image src="../../static/icons/storeHeart.png" mode=""></image>
					<text>434</text>
				</view>
			</view>
		</view>
	<!-- 	//新增 -->
		<!-- </view>
			<view class="operation">
				<view class="operationItem">
					<image src="../../static/icons/transmit.png" mode=""></image>
					<text>114</text>
				</view>
				<view class="operationItem">
					<image src="../../static/icons/leaveMess.png" mode=""></image>
					<text>1241</text>
				</view>
				<view class="operationItem">
					<image src="../../static/icons/storeHeart.png" mode=""></image>
					<text>434</text>
				</view>
			</view>
		</view> -->
		
		<view class="postMessage" @click="postMessage(url)">
			<image src="../../static/icons/post.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content:[
					
					{
						user:{
							userName:"娃哈哈",
							time:"2023/3/11"
						},
						title:"软考备考需要如何备考？",
						topic:" 说到备考，因为每个人的基础不同，接受能力也不同，而且软考还是有难度的，需要多花时间的，如果时间充裕建议提前备考呢~合理安排时间，要有计划、有目的、高效的备考，软考要记要背的东西也多，刷题也要刷很多，建议至少近几年的真题都要认真剖析",
						path:"/pages/forum/forumContent/forumContent"
					},
					{
						user:{
							userName:"柒柒",
							time:"2023/3/10"
						},
						title:"2022年下半年软考题难吗？",
						topic:"俗话说，得案例者得分数，得计算者得天下。有很多考生非常担心信息系统项目管理师中的计算题部分，说我的数学很差，我有小学初中的数学水平，我能不能考这个考试？",
						path:"/pages/forum/forumContent/forumContent"
					},
					
					// 新增
					
					
					
					
					
				],
				
			}
		},
		
		
		methods: {
			postMessage(url){
				uni.navigateTo({
					url:"./postMessage/postMessage"
				})
				
			},
			toforumContent(url){
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: #e9f1ff;
		font-family: "微软雅黑";
		background: #eee;
	}
.forum{
	padding: 20rpx;
	.content{
		display: flex;
		flex-wrap: wrap;
		background: #fff;
		padding: 20rpx;
		border-radius: 10rpx;
		margin-bottom: 20rpx;
		.header{
			display: flex;
			width: 100%;
			.headPortrait{
				width: 80rpx;
				height: 80rpx;
				border-radius: 50%;
				margin-right: 20rpx;
				text-align: center;
				line-height: 80rpx;
				border: 1px solid #eee;
				overflow: hidden;
				image{
					width: 60rpx;
					height: 60rpx;
					vertical-align: middle;
				}
			}
			.user{
				.userName{
					font-size: 18px;
					font-weight: bold;
					display: block;
				}
				.time{
					font-size: 28rpx;
					color: #CCCCCC;
				}
			}
		}
	}
	.title{
		margin-top: 20rpx;
		 display: inline-block;
		  white-space: nowrap; 
		  width: 100%; 
		  overflow: hidden;
		  text-overflow:ellipsis;
		  font-size: 30rpx;
		  font-weight: bold;
	}
	.topic{
		display: flex;
		height: 140rpx;
		font-size: 28rpx;
		line-height: 46rpx;
		border-radius: 20rpx;
		font-size: 32rpx;
		letter-spacing: 1.5px;
		margin-top: 20rpx;
		text-overflow: -o-ellipsis-lastline;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		line-clamp: 3;
		-webkit-box-orient: vertical;
	}
	.operation{
		display: flex;
		justify-content: space-between;
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		.operationItem{
			image{
				width: 40rpx;
				height: 40rpx;
				vertical-align: middle;
				margin-right: 10rpx;
			}
			text{
				font-size: 28rpx;
				color: #ccc;
			}
		}
	}
	.postMessage{
		position: fixed;
		right: 30rpx;
		bottom: 280rpx;
		width: 100rpx;
		height: 100rpx;
		border-radius: 50%;
		text-align: center;
		line-height: 100rpx;
		background: rgba(116, 135, 255, 0.6);
		image{
			width: 60rpx;
			height: 60rpx;
			vertical-align: middle;
		}
	}
}
</style>
